import { defineConfig } from "rollup";
import { readFileSync } from "node:fs";
const packageJson = JSON.parse(
  readFileSync(new URL("./package.json", import.meta.url))
);

export default defineConfig({
  input: "./src/index.js",
  external: ["axios"],
  output: [
    {
      file: packageJson.module,
      format: "es",
    },
    {
      file: "cjs/cjs.js",
      format: "cjs",
    },
    {
      name: packageJson.name,
      file: packageJson.main,
      format: "umd",
      globals: {
        axios: "axios",
      },
    },
  ],
});
